package newTest.test11;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class CountingConnectionMaker implements ConnectionMaker {

	int counter = 0 ; 
	private ConnectionMaker realConnectionMaker;
	
	public CountingConnectionMaker(ConnectionMaker realConnectionMaker){
		this.realConnectionMaker = realConnectionMaker;
	}
	
	@Override
	public Connection makeConnection() throws SQLException,
			ClassNotFoundException {
			counter ++;
		return realConnectionMaker.makeConnection();
	}
	public int getCounter(){
		return this.counter;
	}

}
